﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System.Collections.Generic;
using System.ComponentModel;
using Sebarf.Core.Interfaces;
using Utils;

#endregion

namespace Sebastof.Services.Interfaces {
	public interface ISebastofApplicationObject : INotifyPropertyChanged, IIdentifiable, IVersionedObject {
		#region Public Properties

		/// <summary>
		/// Get the attached <see cref="IInterLinqContextImpl"/>
		/// </summary>
		IServiceLocatorService AttachedServiceLocatorService { get; }

		/// <summary>
		/// Get the internal used <see cref="IDataHandlingStrategy"/>
		/// </summary>
		IDataHandlingStrategy UsedDataHandlingStrategy { get; }

		#endregion

		#region Public Methods

		/// <summary>
		/// Get the value by the given key
		/// </summary>
		/// <param name="key"></param>
		/// <returns></returns>
		object GetValue(string key);

		/// <summary>
		/// used to get all values of this do
		/// </summary>
		/// <returns></returns>
		KeyValuePair<string, object>[] GetValues();

		/// <summary>
		/// Get the value by the given key and type
		/// </summary>
		/// <param name="key"></param>
		/// <returns></returns>
		T GetValue<T>(string key);

		/// <summary>
		/// sets the given value
		/// </summary>
		/// <param name="key"></param>
		/// <param name="value"></param>
		void SetValue(string key, object value);

		/// <summary>
		/// Signales that the given value is commited
		/// </summary>
		/// <param name="obj"></param>
		void SignalIsCommited();

		/// <summary>
		/// are notified if a value has been set
		/// </summary>
		/// <param name="callback"></param>
		void RegisterSetValueObserver(IAppliedChangesOnObjectsCollectorService callback);

		/// <summary>
		/// DeRegisterSetValueObserver^-1
		/// </summary>
		/// <param name="callback"></param>
		void DeRegisterSetValueObserver(IAppliedChangesOnObjectsCollectorService callback);

		#endregion
	}
}